﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdRxVariantValue : OdRxVariant
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdRxVariantValue(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdRxVariantValue_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdRxVariantValue obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdRxVariantValue()
		{
			this.Dispose();
		}

		public new virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdRxVariantValue(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public void assign(OdRxVariant pVariant)
		{
			GlobalsPINVOKE.OdRxVariantValue_assign(this.swigCPtr, OdRxVariant.getCPtr(pVariant));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(OdRxObject pObject) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_0(OdRxObject.getCPtr(pObject)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(OdRxVariant pVariant) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_1(OdRxVariant.getCPtr(pVariant)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(bool value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_2(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(byte value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_3(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(sbyte value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_4(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(ushort value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_5(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(short value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_6(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(uint value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_7(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(int value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_8(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(ulong value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_9(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(long value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_10(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(double value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_11(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(string value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_12(value), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(OdStringArray value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_13(OdStringArray.getCPtr(value)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxVariantValue(OdRxObjectPtrArray value) : this(GlobalsPINVOKE.new_OdRxVariantValue__SWIG_14(OdRxObjectPtrArray.getCPtr(value)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int AsInt32()
		{
			int result = GlobalsPINVOKE.OdRxVariantValue_AsInt32__SWIG_0(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public long AsInt64()
		{
			long result = GlobalsPINVOKE.OdRxVariantValue_AsInt64__SWIG_0(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double AsDouble()
		{
			double result = GlobalsPINVOKE.OdRxVariantValue_AsDouble__SWIG_0(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public string AsString()
		{
			string result = GlobalsPINVOKE.OdRxVariantValue_AsString__SWIG_0(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
